from urllib import parse


class UrlUtils:
    # 获取url地址中所有参数数据
    def getUrlAllparam(self,url):
        params = parse.parse_qs(parse.urlparse(parse.unquote(url["url"])).query)
        return params

    # 公共方法获取url地址中的参数数据

    def getUrlSingleParam(self,key, url):
        params = self.getUrlAllparam(url)
        return params[key][0]